package Operation;

import BOOK.BookList;

/**
 * Creat with IntelliJ IDEA
 * Description:
 * User:WZW
 * Date:2021-11-27
 * Time:19:01
 */
public class Return implements IOperation{
    @Override
    public void work(BookList bookList) {
        System.out.println("归还图书：");
        System.out.println("请输入你要还的书：>");
        String name = scanner.nextLine();
        int index = bookList.search(name);
        if (index==-1){
            System.out.println("没有你要还的书！");
            return;
        }
        bookList.getIndex(index).setBorrowed(false);
        System.out.println("还书成功！");
    }
}
